#pragma once

#include <butil/logging.h>
#include <brpc/server.h>
#include <frpc.pb.h>

namespace frpcType{

   class UserServiceImpl : public UserSvc {
public:
    UserServiceImpl() {};
    virtual ~UserServiceImpl() {};
    virtual void GetUserInfo(google::protobuf::RpcController* cntl_base,
                      const DefaultArg* request,
                      UserInfo* response,
                      google::protobuf::Closure* done) {

        brpc::ClosureGuard done_guard(done);

        brpc::Controller* cntl =
            static_cast<brpc::Controller*>(cntl_base);

        // The purpose of following logs is to help you to understand
        // how clients interact with servers more intuitively. You should 
        // remove these logs in performance-sensitive servers.
        LOG(INFO) << "Received request[log_id=" << cntl->log_id() 
                  << "] from " << cntl->remote_side() 
                  << " to " << cntl->local_side()
                  << " body: " << request->arg_string(0)
                  << " (attached=" << cntl->request_attachment() << ")";

        // Fill response.
       response->set_phone("133123123");
       response->set_name("mike");

    cntl->response_attachment().append(cntl->request_attachment());
    }
};
    

}